<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
        <title><!--装机单--></title>
        <meta charset="utf-8">
        <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <link rel="stylesheet" href="css/project/ui-input-v3.css">
        <link rel="stylesheet" href="css/ui-base.css">
        <link rel="stylesheet" href="css/ui-box.css">
        <link rel="stylesheet" href="css/project/style.css">
        <link rel="stylesheet" href="css/zv_common.css">
        <style>
            .datecolor {
                color: #525252;
                padding-top: 0.4em;
            }
            .b-norarea {
                border-color: #ccc;
            }
            
            .passenger_infoborder {
                border-bottom: 1px solid #e5e5e5;
            }
            
            .passenger_infoborderb {
                border: 0px;
            }
            
            .passinfoba {
                background: #003f9e;
                font-weight: bold;
            }
            
            input[type =
            "radio"]:checked + div.passinfoba {
                background: #003f9e;
                color: #fff;
                border: 0px;
                overflow: hidden;
            }
            
            input[type = radio] + div.passinfoba {
                color: #003079;
                background: #fff;
                border-bottom: 0px;
                overflow: hidden;
            }
            
            .zvtakeoff {
                background: url(images/takeoff.png) no-repeat left;
            }
            
            .zvlanding {
                background: url(images/landing.png) no-repeat right
            }
            
            .zvtakeofff {
                color: #003079;
                font-size: 1em;
                font-weight: bold;
            }
            
            .datecolor1 {
                color: #525252;
            }
            
            .zvrefresh {
                margin-top: 1.2em;
                background: url(images/42.png) no-repeat;
                background-size: 50%
            }
            
            .ubr {
                border-right: solid #ccc 1px;
                border-bottom: 0px;
            }
        </style>
        <script src="js/zy_control.js">
        </script>
        <script src="js/zy_click.js">
        </script>
        <script src="js/zy_json.js">
        </script>
		 <script src="js/base64.js">
        </script>
        <script src="js/main.js">
        </script>
        <script src="js/init.js">
        </script>
    </head>
    <body class="um-vp" ontouchstart>
        <div id="page_1" class="ub ub-ver um-vp">
            <form action="javascript:;" method="get" id="search_form" name="search_form">
                <div style="overflow:hidden;" class="c-wh">
                    <!--单选框开始--><input type="hidden" id="carrier" value="1" name="carrier">
                    <div class="ub uc-a1 t-bla c-gra uba b-gra tx-c umar-a umh4" style="border:#ccc solid 1px;">
                        <input type="radio" name="radio" class="uhide" value="1" checked="checked">
                        <div class="uinn2 ubr b-gra uc-l1 ub-f1 passinfoba" style="border-bottom:0px" onclick="installed_checked_search(1)" onmousedown="zy_touch('',zy_for)" ontouchstart="zy_touch('',zy_for)">航班号</div>
                        <input type="radio" name="radio" class="uhide" value="2">
                        <div class="uinn2 b-gra uc-r1 ub-f1 passinfoba" style="border-bottom:0px" onclick="installed_checked_search(2)" onmousedown="zy_touch('',zy_for)" ontouchstart="zy_touch('',zy_for)">起降城市</div>
                    </div>
                    <!--单选框结束-->
                </div>
				<div  id="flightNo_type" > 
	                <div class='ub umh4 uinn ubb b-norarea c-wh' >
	                    <div class=" ub-ac ulev0 datecolor umw3">
	                        航班号：
	                    </div>
	                    <div class="ub ub-f1  ">
	                        <div class="uba uinput passenger_infoborderb" style="width:100%">
	                            <input placeholder="请输入航班号" type="text" id="flightNo" style="width:100%"  maxlength="6"  value="">
	                        </div>
	                    </div>
	                </div>
				</div>
				<div  id="airport_type" style="display:none;">
				 <div class='ub umh4 uinn ubb b-norarea c-wh' >
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="12%" align="left">
                                <div id="goleft" onclick="openAirPort('go');" style="display:block;">
                                    <img src="images/takeoff.png">
                                </div>
                                <div id="rising" onclick="cancel('rising');" style="display:none;">
                                    <img src="images/del.png">
                                </div>
                            </td>
                            <td width="30%" align="left">
                                <div onclick="openAirPort('go');">
                                    <div class="umh3 ulev0">出发城市</div>
                                    <div id="dept_code" style="display:none;"></div>
                                    <div class="zvtakeofff" id="dept">选择城市</div>
                                </div>
                            </td>
                            <td width="16%" align="center">
                                <div onclick="adjustable()">
                                    <img src="images/42.png">
                                </div>
                            </td>
                            <td width="30%" align="right">
                                <div onclick="openAirPort('come');">
                                    <div class="umh3 ulev0">
                                        <span>到达城市</span>
                                    </div>
                                    <div id="arr_code" style="display:none;">PEK</div>
                                    <div class=" umh3 zvtakeofff" id="arr">北京首都</div>
                                </div>
                            </td>
                            <td width="12%" align="right">
                                <div id="goright" onclick="openAirPort('come');">
                                    <img src="images/landing.png">
                                </div>
                                <div id="drop" onclick="cancel('drop');" style="display:none;">
                                    <img src="images/del.png">
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
				
				</div>
				
                <div class='ub umh4 uinn ubb b-norarea c-wh'>
                    <div class=" ub-ac ulev0 umw3 datecolor" style="">
                        日　期：
                    </div>
                    <div class="ub ub-f1">
                        <div class="uba uinput passenger_infoborderb" id="pdate" style="width:100%; line-height:1.7em" onclick="checked_day('pdate')">
                        </div>
                    </div>
                </div>
                <div class="ub ub-ver" style="clear:both;">
                    <div ontouchstart="zy_touch('zv-btn-act')" class="zvbtn  c-blu1  t-wh tx-c uc-a1 zvbtnpadding" onclick="search()">
                        确   定
                    </div>
                </div>
            </form>
            <div class="logobg">
                <img src="images/logobg.png" width="80%">
            </div>
        </div>
        <script>
            zy_init();
            var bodyH = document.body.clientHeight;
			$$("pdate").innerHTML = getNowFormatDate();
			var backup_pdate_zjd= localStorage.getItem("backup_pdate_zjd")
			if(backup_pdate_zjd!='null' && backup_pdate_zjd!=null && backup_pdate_zjd!='' &&backup_pdate_zjd!=undefined)
			{
			//$$("pdate").innerHTML =backup_pdate_zjd;	
			}
            document.getElementById("page_1").style.height = (bodyH - 10) + "px"
            function openAirPort(type){
                localStorage.setItem("zvAirPortType", type);
                localStorage.setItem("html", "installed_single_search");
                openNewWin('airport', 'airport.html');
            }
            function setAirPort(name, code){
                var zvAirPortType = localStorage.getItem("zvAirPortType");
                if (zvAirPortType == 'go') {
                    $$("dept").innerHTML = name;
                    $$("dept_code").innerHTML = code;
                }
                if (zvAirPortType == 'come') {
                    $$("arr").innerHTML = name;
                    $$("arr_code").innerHTML = code;
                }
            }
            function adjustable(){
                var arr_code = $$("arr_code").innerHTML;
                var arr = $$("arr").innerHTML;
                var dept_code = $$("dept_code").innerHTML;
                var dept = $$("dept").innerHTML;
                $$("dept_code").innerHTML = arr_code;
                $$("dept").innerHTML = arr;
                $$("arr_code").innerHTML = dept_code;
                $$("arr").innerHTML = dept;
            }
            window.uexOnload = function(type){
				setLocalLocation(setDefauleIATACodeCallback);
                if (!type) {
                    uexWindow.setBounce("0");
                }
            }
			function installed_checked_search(type){
				if(type==2)
				{
					$$("airport_type").style.display='block';
					$$("flightNo_type").style.display='none';
					$$("carrier").value='2';
				}
				else
				{
					$$("airport_type").style.display='none';
					$$("flightNo_type").style.display='block';	
					$$("carrier").value='1';
				}
			}
			 function search(){
               checkUserRole(ZV_EMPLOYEE_NUMBER, 'BTN_47_48', function(){LoadDataS()});
            }
            function LoadDataS(type){
                var carrier = $$("carrier").value; /*查询条件*/
                var flightNo = $$("flightNo").value;/*航班号*/
                var pdate = $$("pdate").innerHTML;/*日期*/
				localStorage.setItem("backup_pdate_zjd",pdate);
                var dept = $$("dept_code").innerHTML;
                var arr = $$("arr_code").innerHTML;
				if(carrier==2){
					 if (dept == '') {$alert('请选择起飞城市');return false;}
		            else  if (arr == '') {$alert('请选择降落城市'); return false;}
					else if (pdate == '') {$alert('请选择日期'); return false;}
					else{
						carrier=''
						flightNo=''
					}
				}
				else
				{
					 if (flightNo == '') { $alert('请输入航班号');return false;}
					 else if (pdate == '') {$alert('请选择日期');return false;}
					 else{
							var carrier = flightNo.replace(/[^a-z]/ig,"")
							carrier=carrier.toUpperCase()
							var flightNo = flightNo.replace(/[^0-9]/ig,""); 
							dept=''
							arr=''
					  }
				}
				Loading(0)
				var wsdl = installed_single_models_url
                var nameSpace = installed_single_models_nameSpace
                var paras = "loginSystem|flightNo|departure|arrival|carrier|flightDate";
                var values = 'ceaMG|' + flightNo + '|' + dept + '|' + arr + '|' + carrier+'|' + pdate ;
                var method = installed_single_models_function
                var jsonPage = [{'key': 'wsdl','type': '0', 'value': wsdl}, {'key': 'KEY1','type': '0','value': '1'}, {'key': 'KEY2','type': '0','value': '1'}, {'key': 'KEY3','type': '0','value': '1'}, {'key': 'nameSpace','type': '0','value': nameSpace}, {'key': 'method','type': '0','value': method}, {'key': 'paras','type': '0','value': paras}, {'key': 'values','type': '0','value': values}];
                $.getJSON(UrlClient + "&SOAPType=yes", function(json){
					var jsondata=json[0].dataList
					if(jsondata.length<1)
					{
						$alert("暂无数据")
						Loading(-1);
					}
					else if(jsondata.length==1)
					{
						localStorage.setItem("installed_refresh_type", "1");
						installed_LoadDataS(jsondata[0].carrier,jsondata[0].flightNo,pdate,jsondata[0].deptAirport,jsondata[0].arrAirport)
					}
					else
					{
						localStorage.setItem("installed_refresh_type", "2");
						var jsonmodels_list = JSON.stringify(json);
	                    localStorage.setItem("jsonmodels_list", jsonmodels_list);
						openNewWin('installed_single_list', 'installed_single_list.html');
						uexEMM.setEvent("1","{'装机单':'查询搜索'}");
						Loading(-1);
					}
                }, "json", function(e){
                }, "POST", jsonPage, false);
            }
			
function installed_LoadDataS(carrier,flightNo,pdate,dept,arr){
                $.getJSON(host_address_url + "MachineSoap?RequestKey=" + RequestKey + "&UserName=CARGO&Password=c7b8f695039f2db66bf00285e15eb8f3&id=IPW_FL_GETELCLOADSHEET&carrier=" + carrier + "&flight_no=" + flightNo + "&flight_date=" + pdate + "&dep_airport=" + dept + "&arr_airport=" + arr + "&version=&URL=" + installed_single_url, function(json){
				if (json == ''||json=='-1') {
                      $alert("暂无数据")
                      Loading(-1);
                }
                else {
	            	  var json = JSON.stringify(json)
	                  localStorage.setItem("zvData", json);
	                  installed_single_models(carrier, flightNo, pdate, dept, arr)
                }
               })
            }
 		function installed_single_models(carrier, flightNo, pdate, dept, arr){
				localStorage.setItem("installed_carrier",carrier);
				localStorage.setItem("installed_flightNo",flightNo);
				localStorage.setItem("installed_pdate",pdate);
				localStorage.setItem("installed_dept",dept);
				localStorage.setItem("installed_arr",arr);
                var wsdl = installed_single_models_url
                var nameSpace = installed_single_models_nameSpace
                var paras = "loginSystem|flightDate|flightNo|departure|arrival|carrier";
                var values = 'ceaMG|' + pdate + '|' + flightNo + '|' + dept + '|' + arr + '|' + carrier;
                var method = installed_single_models_function
                var jsonPage = [{'key': 'wsdl','type': '0', 'value': wsdl}, {'key': 'KEY1','type': '0','value': '1'}, {'key': 'KEY2','type': '0','value': '1'}, {'key': 'KEY3','type': '0','value': '1'}, {'key': 'nameSpace','type': '0','value': nameSpace}, {'key': 'method','type': '0','value': method}, {'key': 'paras','type': '0','value': paras}, {'key': 'values','type': '0','value': values}];
                $.getJSON(UrlClient + "&SOAPType=yes", function(json){
                    var jsonmodels = JSON.stringify(json);
                    localStorage.setItem("jsonmodels", jsonmodels);
					Loading(-1);
					openNewWin('installed_single_search_result', 'installed_single_search_result.html');                    
                }, "json", function(e){
                }, "POST", jsonPage, false);
            }
///////////////////////////////////////////////////////////////////一分钟刷新一次
function LoadDataSreload(carrier, flightNo, pdate, dept, arr){
	$.getJSON(host_address_url + "MachineSoap?RequestKey=" + RequestKey + "&UserName=CARGO&Password=c7b8f695039f2db66bf00285e15eb8f3&id=IPW_FL_GETELCLOADSHEET&carrier=" + carrier + "&flight_no=" + flightNo + "&flight_date=" + pdate + "&dep_airport=" + dept + "&arr_airport=" + arr + "&version=&URL=" + installed_single_url, function(json){
		if (json == ''||json=='-1') {
			$alert("暂无数据")
		}
		else {
			var json = JSON.stringify(json)
			localStorage.setItem("zvDatareload", json);
			ueppscript("installed_single_search_result","content","installed_single_v()");
		}
	})
}	
///////////////////////////////////////////////////////////////////一分钟刷新一次	

///////////////////////////////////////////////////////////////////版本选择
function LoadDataversion(carrier, flightNo, pdate, dept, arr,version){
	if(version==undefined||version=='undefined'||version==null||version=='null')
	{
		version=''
	}
	$.getJSON(host_address_url + "MachineSoap?RequestKey=" + RequestKey + "&UserName=CARGO&Password=c7b8f695039f2db66bf00285e15eb8f3&id=IPW_FL_GETELCLOADSHEET&carrier=" + carrier + "&flight_no=" + flightNo + "&flight_date=" + pdate + "&dep_airport=" + dept + "&arr_airport=" + arr + "&version="+version+"&URL=" + installed_single_url, function(json){
	     if (json == ''||json=='-1') {
			$alert("暂无数据")
		}
		else {
			var json = JSON.stringify(json)
			localStorage.setItem("zvDataversion", json);
			ueppscript("installed_single_search_result","content","installed_version()");
		}
	})
}	
///////////////////////////////////////////////////////////////////版本选择	

			
        </script>
    </body>
</html>
